package com.design.model.composite;

/**
 * @program: study
 * @className: Leaf
 * @description: TODO
 * @author: kukuxiahuni
 * @create: 2019-07-03 11:39
 * @version: v1.0
 **/
public class Leaf extends Component {
    public Leaf(String name) {
        super(name);
    }

    @Override
    public void add(Component component) {
        System.out.println("叶子不能添加");

    }

    @Override
    public void remove(Component component) {
        System.out.println("叶子不呢删除");

    }

    @Override
    public void display(int depth) {
        System.out.printf("-%d%s\n", depth, name);

    }
}
